package com.esun.server.controller;

import com.esun.api.interfaces.IDatabaseLogApi;
import com.esun.api.request.DatabaseLogRequestDto;


import com.esun.common.response.RestResponse;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.util.List;


/**
 * (DatabaseLog)控制类
 *
 * @author baron.wubo
 * @date 2021-10-13 10:39:19
 */

@RestController
@RequestMapping("/log/v1/databaseLog")
public class DatabaseLogController implements IDatabaseLogApi {
    @Resource(name = "DatabaseLogApi")
    IDatabaseLogApi databaseLogApi;

    @Override
    public RestResponse getDatabaseLogPostByPage(DatabaseLogRequestDto requestDto) {
        return databaseLogApi.getDatabaseLogPostByPage(requestDto);
    }

    @Override
    public RestResponse getLogErrorTotal() {
        return databaseLogApi.getLogErrorTotal();
    }

    @Override
    public RestResponse addDatabaseLog(List<DatabaseLogRequestDto> requestDtoList) {
        return databaseLogApi.addDatabaseLog(requestDtoList);
    }

    @Override
    public RestResponse updateDatabaseLog(List<DatabaseLogRequestDto> requestDtoList) {
        return databaseLogApi.updateDatabaseLog(requestDtoList);
    }

    @Override
    public RestResponse deleteDatabaseLog(List<DatabaseLogRequestDto> requestDtoList) {
        return databaseLogApi.deleteDatabaseLog(requestDtoList);
    }

    @Override
    public RestResponse importDatabaseLog(MultipartFile file) {
        return databaseLogApi.importDatabaseLog(file);
    }

    @Override
    public void exportDatabaseLog(DatabaseLogRequestDto requestDto) {
        databaseLogApi.exportDatabaseLog(requestDto);
    }

    @Override
    public void downloadTemplate(String path) {
        databaseLogApi.downloadTemplate(path);
    }
}
